/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package bl;

import java.awt.Graphics2D;
import java.util.LinkedList;
import resources.SpaceGeneration;

/**
 *
 * @author Alexander_Seiner
 */
public class GalaxyCore extends BasicGraphicElement
{
    private String coreType;
    
    
    public GalaxyCore(float posX, float posY, float width, float height, LinkedList<BasicGraphicElement> childElements, String coreType) {
        super(posX, posY, width, height, childElements);
        this.coreType = coreType;
        
        if(coreType.equals(SpaceGeneration.galaxyCores.get(1)))
        {
            this.setPosX(this.getPosX()-width/4);
            this.setWidth(this.getWidth()+this.getWidth()/2);
        }
    }

    @Override
    public void draw(Graphics2D g2d) 
    {
        g2d.drawOval((int)this.getPosX(), (int)this.getPosY(), (int)this.getWidth(), (int)this.getHeight());
        
        if(this.getChildElements() != null && !this.getChildElements().isEmpty())
        {
            for(BasicGraphicElement bge : this.getChildElements())
            {
                bge.draw(g2d);
            }
        }
    }

    public String getCoreType() {
        return coreType;
    }

    public void setCoreType(String coreType) {
        this.coreType = coreType;
    }
    
}
